package com.erpservertwo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.erpservertwo.entity.Emp;
import com.erpservertwo.mapper.LoginMapper;
import com.erpservertwo.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;

    @Override
    public Emp login(String username, String password) {
        QueryWrapper<Emp> wrapper = new QueryWrapper<>();
//        需要校验密码加密加盐等操作，todo
        wrapper.eq("username", username).eq("password", password);
        return loginMapper.selectOne(wrapper);
    }
}
